<style>

    @media (min-width: 992px) {
        .navbar-expand-lg .navbar-nav .nav-link {
            padding-right: 1.6rem;
            padding-left: 1.6rem;
        }
    }

</style>
<nav id="header" class="navbar  navbar-expand-lg navbar-dark bg-dark" >
    <a class="navbar-brand" href="#">图书管理系统</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
                <a class="nav-link" href="/">首页</a>
            </li>
            <!--<li class="nav-item">-->
                <!--<a class="nav-link" href="#">公告信息</a>-->
            <!--</li>-->
            <li class="nav-item">
                <a class="nav-link" href="{:url('Cart/index')}">购物车<span id="cart_num" style="vertical-align: top;" class="badge badge-danger ml-1">{$cart_num}</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{:url('User/index')}">个人中心</a>
            </li>
        </ul>
        <form class="form-inline my-2 my-lg-0" action="{:url('Book/search')}" method="get">
            <input class="form-control mr-sm-2" name="keyword" type="search" placeholder="请输入图书名称" aria-label="Search">
            <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
        </form>
    </div>
</nav>